<?php
/*
 * General Functions
 * 
 * Mainly used functions
 * 
 * @author : Jason Meulenhoff
 * @mail : mail@kacangboi.com
 * @web : http://kacangboi.com
 * @copyright : KacangNetworks 2010
 * 
 */

function setupLiveEnviroment()
{
	$database = new databaseManager();
	$temp = $database->getLiveSettings();	
	
	switch($temp['language'])
	{
		case "ENGLISH" : 
			return "../templates/language/english.html";
		break; 
		case "DUTCH" : 
			return "../templates/language/dutch.html";
		break;
		case "BOTH" : 
			return "../templates/language/english.html";
		break;
		default :
			return "../templates/error.html";
		break;
	}
}

function selectedEnviroment()
{
	$database = new databaseManager();
	$temp = $database->getLiveSettings();	
	return $temp['value'];
}

function selectedUrl()
{
	$database = new databaseManager();
	$temp = $database->getLiveUrl();	
	return $temp['value'];
}

function selectedPb($point)
{
	$database = new databaseManager();
	$temp = $database->readPublishingPoint($point);	
	return $temp['value'];
}

function savePb($point,$val)
{
	$database = new databaseManager();
	$temp = $database->savePublishingPoint($point,$val);	
}

function saveUrl($value)
{
	$database = new databaseManager();
	$database->saveUrl($value);
}

function clearchat()
{
	$database = new databaseManager();
	$database->clearChat();
}

function disableLive($value)
{
	$database = new databaseManager();
	$database->disableLive($value);
}

function getdisabled()
{
	$database = new databaseManager();
	return $database->getLive();
}
?>